package com.cosina.game.tank.model.impl;

import android.graphics.Point;
import android.view.SurfaceHolder;

import com.cosina.game.tank.model.War;
import com.cosina.game.tank.view.WarView;


public class SimpleWar extends War{

	public SimpleWar(WarView warField, SurfaceHolder holder) {
		super(warField,holder);
		justiceTank = new JusticeTank(new Point(100, 100),this);
	}
	
	public int getTotal(){
		return total;
	}
	public int total = 20;
	public int scrrenMax = 3;
	public int prepare = total;
	public int getPrepare(){
		return prepare;
	}
	
	@Override
	public void withTimeGo(){
		if(enemyTanks.size()<scrrenMax && prepare > 0){
			for(Point point : bornPlaces){
				if(isTileEmpty(point)){
					prepare --;
					enemyTanks.add(new EnemyTank(new Point(point.x*32, point.y*32),this));
					break;
				}
			}
		}
	}
	
	public int getScreenMax(Point bornPlace){
		return scrrenMax;
	}
	private Point[] bornPlaces = new Point[]{new Point(0,0), new Point(5,0), new Point(10,0)};
	public Point[] getBornPlaces(){
		return bornPlaces;
	}
	
	public Point getSelfBornPlace(){
		return new Point(5,8);
	}
}
